package MyStringTestDemo01;

public class MyStringTest  {
    public static void main(String[] args) {
        String str1 = "hello java";
        String str2 = "hello java";

        if (str1 .equals(str2)){
            String newStr = str1.replaceAll("\\s+","").replace("java","world");
            System.out.println(newStr);
        }else {
            System.out.println("两个字符串不相等");
        }

    }
}
